package com.micro.service.impl;

import com.micro.dao.SubjectDAO;
import com.micro.model.Subject;
import com.micro.service.SubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SubjectServiceImpl implements SubjectService {

	@Autowired
	private SubjectDAO subjectDAO;

	@Override
	public int insertSubject(Subject subject) {
		subjectDAO.insertSubject(subject);
		return 0;
	}

	@Override
	public int insertSubjectHis(Subject subject) {
		subjectDAO.insertSubjectHis(subject);
		return 0;
	}

	@Override
	public int editSubject(Subject subject) {
		subjectDAO.insertSubjectHis(subject);
		subjectDAO.editSubject(subject);
		return 0;
	}

	@Override
	public List<Subject> querySubjectList(Subject conditionBean) {
		return subjectDAO.querySubjectList(conditionBean);
	}

	@Override
	public List<Subject> querySubjectListByCond(Subject conditionBean) {
		return subjectDAO.querySubjectListByCond(conditionBean);
	}

	@Override
	public List<Subject> querySubjectListByCondition(Subject subject) {
		return subjectDAO.querySubjectListByCondition(subject);
	}

	@Override
	public Subject querySubjectListByID(Subject subject) {
		return subjectDAO.querySubjectListByID(subject);
	}



	@Override
	public int querySubjectIsExistByTitle(String subjectTitle) {
		return subjectDAO.querySubjectIsExistByTitle(subjectTitle);
	}
}
